class TasksController < ApplicationController

  hobo_model_controller
  
  def create
    @this = Task.create(params[:task])
    respond_to do |format|
      format.html { redirect_to task_path(@this)}
      format.js do
        render :update do |page|
          page.insert_html :bottom, 'task_rows', "<tr class='list_table' id='list_row_#{@this.id}'><td class='list_table'>#{Hobo::Dryml.render_tag @template, 'object_link', {:obj => @this}} #{Hobo::Dryml.render_tag @template, 'delete_button', {:obj => @this, :update => "task_rows"}}</td><td class='list_table'>New Task</td><td class='list_table'>#{Hobo::Dryml.render_tag @template, 'object_link', {:obj => @this.owner}}</td><td class='list_table'> #{Hobo::Dryml.render_tag @template, 'show', {:obj => @this, :attr => 'due_date'}} </td></tr>"
          page.visual_effect "highlight", "list_row_#{@this.id}"
          page.visual_effect "fade", "ajax_progress"
        end
      end
    end
  end
end
